﻿<Window
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
	x:Class="WpfCmd.Window1"
    Title="DOS Command" 
    MouseWheel="Window_MouseWheel" 
    KeyUp="Window_KeyUp"
    KeyDown="Window_KeyDown"  
	Height="681" Width="659"  Opacity="1"
	mc:Ignorable="d"
	Icon="/Stylish DOS Box;component/Box_Green.ico" >
	<Window.Resources>
		<Style x:Key="{x:Type TextBoxBase}" BasedOn="{x:Null}" TargetType="{x:Type TextBoxBase}">
			<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
			<Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.WindowBrushKey}}"/>
			
			<Setter Property="Padding" Value="1"/>
			<Setter Property="AllowDrop" Value="true"/>
			<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type TextBoxBase}">
						<Grid>
							<Rectangle Fill="{TemplateBinding Background}" RadiusX="20.5" RadiusY="20.5" HorizontalAlignment="Stretch" Margin="0,0,2,8" VerticalAlignment="Stretch" Width="Auto" Height="Auto"/>
							<ScrollViewer x:Name="PART_ContentHost" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Margin="2" Opacity="{TemplateBinding Opacity}" Foreground="{TemplateBinding Foreground}" OpacityMask="{TemplateBinding OpacityMask}"/>
						</Grid>
						<ControlTemplate.Triggers>
							<Trigger Property="IsEnabled" Value="false">
								<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
							</Trigger>
						</ControlTemplate.Triggers>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<Style x:Key="{x:Type Hyperlink}" TargetType="{x:Type Hyperlink}">
			<Setter Property="Foreground" Value="Blue"/>
			<Setter Property="TextDecorations" Value="Underline"/>
			<Style.Triggers>
				<Trigger Property="IsMouseOver" Value="true">
					<Setter Property="Foreground" Value="Red"/>
				</Trigger>
				<Trigger Property="IsEnabled" Value="false">
					<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
				</Trigger>
				<Trigger Property="IsEnabled" Value="true">
					<Setter Property="Cursor" Value="Hand"/>
				</Trigger>
			</Style.Triggers>
		</Style>
		<Style x:Key="ResultsTextBoxStyle" TargetType="{x:Type RichTextBox}">
			<Style.Resources>
				<Style x:Key="{x:Type FlowDocument}" TargetType="{x:Type FlowDocument}">
					<Setter Property="OverridesDefaultStyle" Value="true"/>
				</Style>
				<Style x:Key="{x:Type Hyperlink}" BasedOn="{StaticResource {x:Type Hyperlink}}" TargetType="{x:Type Hyperlink}">
					<Style.Triggers>
						<Trigger Property="IsMouseOver" Value="true">
							<Setter Property="Foreground" Value="Blue"/>
						</Trigger>
						<Trigger Property="IsEnabled" Value="false">
							<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
						</Trigger>
					</Style.Triggers>
				</Style>
			</Style.Resources>
			<Setter Property="MinWidth" Value="10"/>
			<Style.BasedOn>
				<StaticResource ResourceKey="{x:Type TextBoxBase}"/>
			</Style.BasedOn>
		</Style>
		<Style x:Key="CommandBoxStyle" BasedOn="{x:Null}" TargetType="{x:Type TextBox}">
			<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
			<Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.WindowBrushKey}}"/>
			<Setter Property="Padding" Value="1"/>
			<Setter Property="AllowDrop" Value="true"/>
			<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type TextBox}">
						<Grid>
							<Rectangle Fill="{TemplateBinding Background}" HorizontalAlignment="Stretch" Width="Auto" RadiusX="7.5" RadiusY="7.5"/>
							<ScrollViewer x:Name="PART_ContentHost" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Margin="2"/>
						</Grid>
						<ControlTemplate.Triggers>
							<Trigger Property="IsEnabled" Value="false">
								<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
							</Trigger>
						</ControlTemplate.Triggers>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
	</Window.Resources>
	<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
		<Grid.RowDefinitions>
			<RowDefinition Height="*" />
			<RowDefinition Height="30" />
		</Grid.RowDefinitions>
        <Border Grid.Row="0" 
                BorderBrush="Transparent"  CornerRadius="5"  Opacity="0.8">
            <Border.Background>
                <RadialGradientBrush>
                    <GradientStop Color="White" Offset="0" />
                    <GradientStop Color="Transparent" Offset="1" />
                    <GradientStop Color="#59FFFFFF" Offset="0.901" />
                    <GradientStop Color="#B9FFFFFF" Offset="0.61" />
                </RadialGradientBrush>
            </Border.Background>
        </Border>
		<RichTextBox x:Name="txtResult" 
					 Foreground="Black" 
					 OpacityMask="White"
					 Grid.Row="0"
					 HorizontalAlignment="Stretch"
					 VerticalAlignment="Stretch"
			IsReadOnly="True" Style="{DynamicResource ResultsTextBoxStyle}" 
			Background="Transparent"   >

			<RichTextBox.LayoutTransform>
				<ScaleTransform x:Name="scaler" CenterX="0"  CenterY="0" />
			</RichTextBox.LayoutTransform>


		</RichTextBox>
        <Border Grid.Row="1" 
                BorderBrush="Transparent"  CornerRadius="5"  Opacity="0.4">
            <Border.Background>
                <RadialGradientBrush>
                    <GradientStop Color="#FF044662" Offset="0" />
                    <GradientStop Color="#AB7DCBCB" Offset="1" />
                </RadialGradientBrush>
            </Border.Background>
        </Border>
        <TextBox x:Name="txtCommand" Grid.Row="1"
				 KeyDown="OnCommandKeyDown" 
				 PreviewKeyDown="txtCommand_PreviewKeyDown"
				 FontSize="14" FontFamily="Consolas" 
				 Text="ping www.google.com" 
				 VerticalContentAlignment="Center" 
				 TabIndex="0" Style="{DynamicResource CommandBoxStyle}" 
				 Foreground="Black" 
				 OpacityMask="LightGray" Opacity="0.8"
				 Background="Transparent"
				 Height="25" 
				 Margin="0,1,0,0"  />
	</Grid>
</Window>
